package com.swpu.project.service;

import com.swpu.project.model.entity.XlxsEntity;
import com.swpu.project.util.XlxsDataType;
import com.swpu.project.util.XlxsSwithcUtil;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.StringRedisTemplate;

import javax.annotation.Resource;
import java.io.IOException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;

/**
 * 用户服务测试
 *
 * @author yupi
 */
@SpringBootTest
class InitDict {


    @Autowired
    StringRedisTemplate stringRedisTemplate;
    @Resource
    XlxsSwithcUtil xlxsSwithcUtil;
   @Resource
   INativeService iNativeService;
   @Resource
   ISecondaryService iSecondaryService;
    @Test
    void initMetal() throws IOException {
        ArrayList<String> strings = new ArrayList<>();
         strings.add("csyx0001");
       //  strings.add("ysyx0002");
        List<XlxsEntity> xlxsEntities = xlxsSwithcUtil.queryData(strings, XlxsDataType.SECONDARY);

        xlxsSwithcUtil.outputXlxsForTest(xlxsEntities,"D:\\res\\test1.xlsx");


    }


@Test
    public  void readTodatabase() throws IOException, ParseException {

    xlxsSwithcUtil.inputXlxsForTest("D:\\res\\test1.xlsx",XlxsDataType.NATIVE);



    }


    @Test
    public  void readTodatabased() throws IOException, ParseException {



    }




}